package top.zhuyougu.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import top.zhuyougu.utils.DateUtils;

/**
 * <p>
 * 
 * </p>
 *
 * @author 猪油骨
 * @since 2022-12-10 01:15:43
 */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
@TableName("b_exception_log")
@ApiModel(value = "ExceptionLog对象", description = "")
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ExceptionLog implements Serializable {
    private static final long serialVersionUID=1L;
    @ApiModelProperty("主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("用户名")
    @TableField("username")
    private String username;

    @ApiModelProperty("IP")
    @TableField("ip")
    private String ip;

    @ApiModelProperty("ip来源")
    @TableField("ip_source")
    private String ipSource;

    @ApiModelProperty("请求方法")
    @TableField("method")
    private String method;

    @ApiModelProperty("描述")
    @TableField("operation")
    private String operation;

    @ApiModelProperty("参数")
    @TableField("params")
    private String params;

    @ApiModelProperty("异常对象json格式")
    @TableField("exception_json")
    private String exceptionJson;

    @ApiModelProperty("异常简单信息,等同于e.getMessage")
    @TableField("exception_message")
    private String exceptionMessage;

    @ApiModelProperty("发生时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = DateUtils.FORMAT_STRING,timezone="GMT+8")
    private Date createTime;


}
